// Program to illustrate the usage of 
// Load function in Golang 

// Including main package 
package main

// importing fmt and sync/atomic 
import (
	"fmt"
	"sync/atomic"
)
/*
https://vimsky.com/examples/usage/atomic-load-function-in-golang-with-examples.html
 */

// Main function 
func main() {

	// Defining a struct type L
	type L struct{ x, y, z int }

	// Defining a variable to assign
	// values to the struct type L
	var r1 = L{9, 10, 11}

	// Defining Value type to store
	// values of any type
	var V atomic.Value

	// Calling Store function
	V.Store(r1)

	// Calling Load method
	var r2 = V.Load().(L)

	// Prints values as
	// stored by recent
	// store method
	fmt.Println(r2)

	// Displays true if satisfied
	fmt.Println(r1 == r2)
}